package cn.cheneyjoo.kafka.impl;

import cn.cheneyjoo.kafka.KafkaMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

@Service
public class KafkaMapperImpl implements KafkaMapper {
    /**
     * 引入kafka消息模板
     */
    @Autowired
    private KafkaTemplate<String,Object> kafkaTemplate;

    @Override
    public void ProducerMessage(Object msg) {
        kafkaTemplate.sendDefault(msg);
    }

}
